import store from '@/store/index.js'
// import {
// 	getDmOAID
// } from '@/uni_modules/duomi-oaid';

// plus.device.getOAID
export async function device_getOAID() {
	return new Promise((resolve, reject) => {
		// getDmOAID((oaid) => {
		// 	console.info("oaid 获取成功 =" + oaid)
		// 	resolve(oaid);

		// }, (err) => {
		// 	console.info("oaid 获取失败 =" + err)
		// })
		plus.device.getOAID({
			success: function(e) {
				const {
					oaid
				} = e;
				console.log('oaid:', oaid);
				resolve(oaid);
			},
			fail: function(e) {
				console.log('getOAID failed: ' + e);
				reject(e)
			}
		});
	});
}

// plus.device.getInfo
export async function device_getInfo() {
	return new Promise((resolve, reject) => {
		plus.device.getInfo({
			success(e) {
				console.log('getDeviceInfo success: ', e);
				resolve(e);
			},
			fail(e) {
				console.log('getDeviceInfo failed: ' + JSON.stringify(e));
			}
		});
	});
}